gtk_widget_init_template (GTK_WIDGET (sl));
}
+static void add_menu (GtkInspectorMenu *sl,
+ GMenuModel *menu,
+ GtkTreeIter *parent);
+
static void
add_item (GtkInspectorMenu *sl,
GMenuModel *menu,
gchar *action = NULL;
gchar *target = NULL;
gchar *icon = NULL;
+ GMenuModel *model;
g_menu_model_get_item_attribute (menu, idx, G_MENU_ATTRIBUTE_LABEL, "s", &label);
g_menu_model_get_item_attribute (menu, idx, G_MENU_ATTRIBUTE_ACTION, "s", &action);
COLUMN_ICON, icon,
-1);
+ model = g_menu_model_get_item_link (menu, idx, G_MENU_LINK_SECTION);
+ if (model)
+ {
+ if (label == NULL)
+ gtk_tree_store_set (sl->priv->model, &iter,
+ COLUMN_LABEL, _("Unnamed section"),
+ -1);
+ add_menu (sl, model, &iter);
+ g_object_unref (model);
+ }
+
+ model = g_menu_model_get_item_link (menu, idx, G_MENU_LINK_SUBMENU);
+ if (model)
+ {
+ add_menu (sl, model, &iter);
+ g_object_unref (model);
+ }
+
g_free (label);
g_free (action);
g_free (target);
<object class= "GtkTreeView">
<property name="visible">True</property>
<property name="model">model</property>
- <property name="activate-on-single-click">True</property>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Label</property>